package com.wzapp.sitposture.usercenter.entity;

import com.wzapp.sitposture.common.converter.DateConverterJson;
import com.wzapp.sitposture.common.converter.DefaultDateConverterJson;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 *  用户配置</br>
 */
@Data
@Entity(name = "user_setting_posture")
public class UserSettingPosture implements Serializable {

    private static final long serialVersionUID = -1L;
    @Id
    @GeneratedValue(generator = "uuid_32")
    @GenericGenerator(name = "uuid_32", strategy = "uuid")
    @Column(length = 32)
    private String id;

    /**
     * 用户ID
     */
    private String userId;
    /**
     * 图片url
     */
    private String url;
    /**
     * 姿态类型 1-姿态正确； 2-头部倾斜； 3-身体左倾； 4-身体右倾； 5-身体前倾； 6-身体后仰
     */
    private Integer type;

    /**
     * 姿态持续时长，单位毫秒
     */
    private Long duration;
    /**
     * 	上传时间，毫秒
     */
    @Convert(converter = DefaultDateConverterJson.class)
    private Long uploadTime;
    /**
     * 创建时间，毫秒
     */
    @Convert(converter = DateConverterJson.class)
    private Long createTime;
}
